﻿using Nop.Core.Domain.Media;
using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Nop.Data.Mapping.Media
{
    public partial class PictureLinkMap : EntityTypeConfiguration<PictureLink>
    {
        public PictureLinkMap()
        {
            this.ToTable("PictureLink");
            this.HasKey(p => p.Id);
            this.Property(p => p.Alt).HasMaxLength(200);
            this.Property(p => p.DisplayText).HasMaxLength(200);
            this.Property(p => p.SystemName).IsRequired().HasMaxLength(200);
            this.Property(p => p.Url).IsRequired().IsMaxLength();

            this.HasRequired(p => p.Collection)
                .WithMany(c => c.PictureLinks)
                .HasForeignKey(p => p.CollectionId);
        }
    }
}
